import {request} from '@umijs/max';
import * as API from "@/services";


/** 期刊专题 分页检索请求 */
export async function queryJournalSpecialTopics(params?: API.JournalSpecialTopicPageQueryParams): Promise<API.RespPageResult<API.JournalSpecialTopic>> {
  return request('/api/v1/journal-special-topic', {
    params,
  });
}

/** 期刊专题 详情请求 */
export async function queryJournalSpecialTopic(bizId: API.EntityId): Promise<API.RespResult<API.JournalSpecialTopic>> {
  return request(`/api/v1/journal-special-topic/${bizId}`);
}

/** 期刊专题 创建请求 */
export async function createJournalSpecialTopic(entity: API.JournalSpecialTopic_Create): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-topic`, {
    method: 'POST',
    data: entity,
  });
}

/** 期刊专题 修改请求 */
export async function modifyJournalSpecialTopic(entity: API.JournalSpecialTopic_Modify): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-topic/${entity.id}`, {
    method: 'PUT',
    data: entity,
  });
}

/** 期刊专题 修改(部分)请求 */
export async function patchJournalSpecialTopic(entity: API.JournalSpecialTopic_Patch): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-topic/${entity.id}`, {
    method: 'PATCH',
    data: entity,
  });
}

/** 期刊专题 删除请求 */
export async function deleteJournalSpecialTopic(bizId: API.EntityId): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-topic/${bizId}`, {
    method: 'DELETE',
  });
}

/** 期刊专题 批量删除请求 */
export async function deleteJournalSpecialTopics(bizIds: API.EntityId[]): Promise<API.RespResult<any>> {
  return request(`/api/v1/journal-special-topic`, {
    method: 'DELETE',
    data: {
      ids: bizIds,
    },
  });
}
